/** 游戏可控制对象 */

class GameObject extends EventDispatcher {

    view: renderer.DisplayObject;

    visible: boolean = true;

    controllable: boolean = true;

    selected: boolean = false;

    constructor() {
        super();
        const gameobjTexture = new Image();
        gameobjTexture.src = 'role.png';
        const role = new renderer.Bitmap(0, 0, gameobjTexture);
        this.view = role;
    }

    update() {
        const speedUp = 1;
        const speedDown = -1;
    }

    //是否选中该对象
    //public hitTest() {
    //
    //}
    //移动方法
    public move() {

    }
    //碰撞检测
    public collisionTest() {

    }
    //消失
    public destroy() {

    }

    hide() {
        this.visible = false;
    }

    show() {
        this.visible = true;
    }
}

class GameObjectManager {
    private gameobjects: GameObject[] = [];
    private container: renderer.DisplayObjectContainer;
    private currentgameobjects = "gameobj"
    parseFromConfig(obj: any) {
        for (let item of obj.npc) {

        }
    }
}

const gameObjectManager = new GameObjectManager();